Method and apparatus for block based image compression with multiple non-uniform block encodings

ABSTRACT

Embodiments of the present invention are directed to a method and apparatus for block based image compression with multiple non-uniform block encodings. In one embodiment, an image is divided into blocks of pixels. In one embodiment the blocks are four pixels by four pixels, but other block sizes are used in other embodiments. In one embodiment, a block of pixels in the original image is compressed using two different methods to produce a first and second compressed block. Thus, each block in the original image is represented by two, typically different, compressed blocks. In one embodiment, color associated with a pixel is determined by combining the compressed information about the pixel in the first compressed block with information about the pixel in the second compressed block. In another embodiment, global information about the image is combined with the information in the first and second compressed blocks.

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] The present application claims the benefit of priority frompending U.S. Provisional Patent Application No. 60/447,862, entitledMethod and Apparatus For Block Based Image Compression With MultipleNon-Uniform Block Encodings, filed on Feb. 13, 2003, which is hereinincorporated by reference in its entirety.

BACKGROUND OF THE INVENTION

[0002] 1. Field of the Invention

[0003] The present invention relates to the field of image compression,and in particular to a method and apparatus for block based imagecompression with multiple non-uniform block encodings.

[0004] 2. Background Art

[0005] Typically, there is a desire to compress images used fortexturing operations in 3D graphics accelerator hardware to improve theperformance of rendering and reduce the memory required to store theinformation. However, prior art image compression methods frequentlyproduce undesired visual artifacts when rendering images, making theirapplication appropriate for a limited number of images. This problem canbe better understood with a review of image compression.

[0006] Image Compression

[0007] Prior art compression techniques can be categorized in at leasttwo ways. First, a technique can be either loss-less or lossy. Second, atechnique can be either fixed or variable rate. A loss-less compressiontechnique is one in which no information about the image is lost due tothe compression. Thus, an image could be compressed and decompressed andthe decompressed image would be identical to the original image. A lossycompression technique is one in which some information about the imageis lost due to the compression. Thus, compression of an image followedby decompression could result in a decompressed image that is notidentical to the original image.

[0008] A fixed rate compression technique reduces the storagerequirement of an image by a fixed percentage. Since most image formatsdo not contain unnecessary data, almost all fixed rate compressiontechniques are lossy in general (however, they may not be lossy for aparticular image). A variable rate compression technique reduces thestorage requirement of an image by an amount that is not known at thetime when the image is compressed. In fact, the storage requirement maynot be reduced at all.

[0009] Because loss-less, variable rate compression techniques areunable to guarantee any rate of compression, graphics systems typicallyuse lossy, fixed rate compression techniques. However, the lossy naturesometimes results in unacceptable image quality (i.e., visualartifacts). Sometimes, it is so difficult to determine when compressionwill result in unacceptable loss of image quality and when it will notthat users and/or systems elect to forgo compression altogether. Assystems are developed that utilize larger amounts of information aboutthe system, the desire for compression increases, but the problem ofunacceptable image quality loss also increases in prior art compressionsystems.

SUMMARY OF THE INVENTION

[0010] Embodiments of the present invention are directed to a method andapparatus for block based image compression with multiple non-uniformblock encodings. In one embodiment of the present invention, an image isdivided into blocks of pixels. In one embodiment the blocks are fourpixels by four pixels, but other block sizes are used in otherembodiments.

[0011] In one embodiment, a block of pixels in the original image isdecompressed into one or more decompressed blocks, each of whichrepresent a partial data value of the original block. Each of theseblocks are compressed using the same or different methods for each blockto produce one or more compressed blocks, which are combined to producean output block. Thus, each block in the original image is representedby a plurality, typically different, compressed blocks each representingall the data values of the block. In one embodiment, color (or a similarvalue) associated with a pixel is determined by combining the compressedinformation about the pixel in one compressed block with compressedinformation about the same pixel in another compressed block. In anotherembodiment, global information about the image is also combined with theinformation in one or more compressed blocks to produce a desired valuefor a pixel.

[0012] According to one embodiment, decompression of the original imageis optimized to reduce the loss. According to one embodiment, theoptimization is performed by conducting a series of functions on a firstsubset comprising of one or more decompressed blocks and applying theresults to a second subset comprising of one or more decompressed blocksdifferent from the ones in the first subset. According to oneembodiment, these functions are iterated through the subsets until apredetermined value of the image is obtained, or some other factor issatisfied. According to another embodiment, the optimization isperformed by projecting an original block to a predefined vector andstoring the original block's magnitude in a first block, and using adevice that projects and subtracts the projection block from of theoriginal block and stores the value in a second block. According toanother embodiment, the optimization is performed by conducting a seriesof functions on the first and second blocks obtained in the previousembodiment. According to another embodiment, the optimization of theprevious embodiment is iterated in a loop until a desired output imageis accomplished or some other factor is met.

[0013] As way of example, two decompressed blocks of an original box ofpixels in the image are compressed using two different methods toproduce a first and a second compressed block by encoding each pixelvalue as an index into a color map before combining the two compressedblocks to generate an output block. In one embodiment, the color mapmaps pixels to a best fit curve with two end points in a color space. Inone embodiment the curve is a straight line. In one embodiment, the endpoints of the best fit curve are values to which the mapping can map. Inanother embodiment, the mapping can map to an extrapolated value betweentwo endpoints along the best fit curve. In still another embodiment, themapping can map to a plurality of different extrapolated values betweentwo endpoints along the best fit curve. In one embodiment, thecompressed block is comprised of the two endpoints of the best fit curveand index values for each of the pixels.

[0014] In an example embodiment, the original block is a four pixel byfour pixel block wherein each pixel value is represented by 24 bits(e.g., a 24-bit RGB color value). Two, 16-bit endpoints for a best fitcurve are stored. Additionally, sixteen 2-bit indices (one for eachpixel in the block) are stored. The indices encode which of the twoendpoint colors or two interpolated values along the curve are thecompressed color for each pixel. The endpoints and the indices comprisea first compressed block.

[0015] In another example embodiment, a compressed block is created byapplying a function to each of the values of the original block toobtain new block values. In one embodiment, the function combinescomponents of each value to reduce the amount of space needed to encodethe data. In an example embodiment, 24-bit RGB values are combined tocreate an 8-bit grey scale value (e.g., (R+G+B)/3). In one embodiment,the new block values are compressed by encoding the block as an indexfor mapping onto a best fit curve. In one embodiment, two endpoints arestored. In another embodiment, the indices map to either the two endpoints or any of one or more interpolated values along the best fitcurve. The two stored endpoints and the block of indices comprise asecond compressed block.

[0016] In an example embodiment, the original block is a four pixel byfour pixel block wherein each pixel value is represented by 24 bits(e.g., a 24-bit RGB color value). The values in the block are convertedto 8-bit grey scale values. Two, 8-bit endpoints for a best fit curveare stored. Additionally, sixteen 3-bit indices (one for each pixel inthe block) are stored. The indices encode which of the two endpointcolors or six interpolated values along the curve are the compressedcolor for each pixel. The endpoints and the indices comprise a thirdcompressed block. Further compressed blocks can be similarly obtained.

[0017] In one embodiment, the error generated by compression is computedand if the error is greater than a threshold value, one or more valuesin the plurality of compressed blocks are altered to reduce the computederror. In one embodiment, the color values are encoded as YCrCb. In oneembodiment, the Y component is encoded in one compressed block and CrCbendpoints are used to encode another compressed block. In anotherembodiment, the color values are encoded as RGB values. One of the RGBcomponents are encoded in one compressed block and endpoints in theother two components' color spaces are used to encode another compressedblock.

[0018] In one embodiment, the function associated with the creation ofone or more compressed blocks is not a grey scale function. Instead, avector that represents the axis of the function is stored in thecompressed blocks. In one embodiment, the vector is of unit length. Inanother embodiment, the vector is of non-unit length. In one embodiment,the vector is a 16-bit axis vector stored in addition to the endpointsand indices as part of the one or more compressed blocks. In anotherembodiment, two 8-bit Theta-Phi axis components are stored in additionto the endpoints and indices as part of the one or more compressedblocks. The Theta-Phi axis components represent angle and elevation ofthe axis vector on a hemisphere. In one embodiment, the number of bitsper index is reduced to allow storage of the vector value withoutincreasing the size of a compressed block beyond a desired maximum size.In various other embodiments, more than one compressed blocks areencoded to represent each original block. Specific bit values have beenfor the purpose of example. One of ordinary skill in the art willrecognize that embodiments of the present invention may be practicedwith original pixel values of any size, using any color encoding scheme,and generating one or more compressed blocks.

BRIEF DESCRIPTION OF THE DRAWINGS

[0019] These and other features, aspects and advantages of the presentinvention will become better understood with regard to the followingdescription, appended claims and accompanying drawings where:

[0020]FIG. 1 is a flow diagram of the process of compressing an image inaccordance with one embodiment of the present invention.

[0021]FIG. 2 is a flow diagram of the process of determining a color fora pixel in accordance with one embodiment of the present invention.

[0022]FIG. 3 is a flow diagram of the process of compressing a pixelblock in accordance with one embodiment of the present invention.

[0023]FIG. 4 is a flow diagram of the process of compressing a 24-bitper pixel, four pixel by four pixel block in accordance with oneembodiment of the present invention.

[0024]FIG. 5 is a flow diagram of the process of compressing a pixelblock in accordance with one embodiment of the present invention.

[0025]FIG. 6 is a flow diagram of the process of compressing a 24-bitper pixel, four pixel by four pixel block in accordance with oneembodiment of the present invention.

[0026]FIG. 7 is a flow diagram of the process of reducing the occurrenceof visual artifacts in accordance with one embodiment of the presentinvention.

[0027]FIG. 8 is a block diagram of a general purpose computer.

[0028]FIG. 9 is an optimization method according to one embodiment ofthe present invention.

[0029]FIG. 10 is another optimization method according to one embodimentof the present invention.

[0030]FIG. 11 is another optimization method according to one embodimentof the present invention.

[0031]FIG. 12 is another optimization method according to one embodimentof the present invention.

[0032]FIG. 13 is another optimization method according to one embodimentof the present invention.

DETAILED DESCRIPTION OF THE INVENTION

[0033] The invention is a method and apparatus for block based imagecompression with multiple non-uniform block encodings. In the followingdescription, numerous specific details are set forth to provide a morethorough description of embodiments of the invention. It is apparent,however, to one skilled in the art, that the invention may be practicedwithout these specific details. In other instances, well known featureshave not been described in detail so as not to obscure the invention.

[0034] Multiple Blocks

[0035] Embodiments of the present invention are directed to a method andapparatus for block based image compression with multiple non-uniformblock encodings. In one embodiment of the present invention, an image isdivided into blocks of pixels. In one embodiment the blocks are fourpixels by four pixels, but other block sizes are used in otherembodiments.

[0036] In one embodiment, a block of pixels in the original image isdecompressed into one or more decompressed blocks, each of whichrepresent a partial data value of the original block. According to oneembodiment, the decompression is based on applying a predefinedtransform function to each block. According to another embodiment, thedecompression is optimized to reduce the loss of image quality. Each ofthese decompressed blocks are then compressed using the same ordifferent methods for each block to produce one or more compressedblocks, which are combined to produce an output block. Thus, each blockin the original image is represented by a plurality, typicallydifferent, compressed blocks each representing all the data values ofthe block. In one embodiment, color (or a similar value) associated witha pixel is determined by combining the compressed information about thepixel in one compressed block with compressed information about the samepixel in another compressed block. In another embodiment, globalinformation about the image is also combined with the information in oneor more compressed blocks to produce a desired value for a pixel.

[0037]FIG. 1 illustrates the process of compressing an image inaccordance with one embodiment of the present invention. At block 100,an image is divided into a plurality of blocks. At block 110, each blockis decompressed into a plurality of decompressed blocks. At step 120,each of these decompressed blocks is compressed to form a plurality ofcompressed blocks. At step 130, the plurality of compressed blocks arecombined to generate an output block.

[0038] Optimization of Decompressed Image Block

[0039] According to one embodiment, the decompression of each originalblock of the image is optimized so that the loss in image quality isreduced to a desired amount, or meets some threshold. According toanother embodiment of the present invention, there are several levels ofoptimization available depending on the threshold or other factors suchas time constraints, quality of output image, etc. It should be notedhere, that the optimization methods mentioned below take into accountonly a limited amount of blocks (2 in these cases), but an unlimitedamount of blocks can be used without departing from the scope of thepresent invention.

[0040] A first optimization method uses a first subset comprising of oneor more decompressed blocks and a second subset comprising of one ormore decompressed blocks different from the ones in the first subset.This optimization method is illustrated in FIG. 9. At block 900, thefirst subset is compressed. Compression schemes are explained in moredetail below. Next, at block 910, the compressed first subset isdecompressed. Next, at block 920, the results of the decompression arefed to a decompress device that changes the data value of the secondsubset. Next, at bock 930, the second subset is compressed. Blocks 900through 930 are repeated for every subset of an image until the entireimage is compressed.

[0041] A second optimization method uses the first optimization methodin addition to a final iteration step. This optimization method isillustrated in FIG. 10. Blocks 900 through 930 remain the same and arenumbered 1000 through 1030. Next, at block 1060, if the optimization hasmet a certain threshold or some other factor, then we stop, else atblock 1040 the compressed second subset is decompressed. Next, at block1050, the results of the decompression are fed to a decompress devicethat changes the data value of the first subset, and blocks 1000, 1010,1020, 1030, and 1060 are repeated again.

[0042] A third optimization method uses an original image block inconjunction with a series of functions to generate two new blocks. Thisoptimization method is illustrated in FIG. 11. At block 1100, anoriginal image block is projected onto a predefined vector, and at block1110 its magnitude is stored in a first new block by a decompressdevice. Concurrently, at block 1120, the projected image is subtractedfrom the original image and the result is stored in a second new block.

[0043] A fourth optimization method uses an original image block inconjunction with a series of functions to generate two new blocks. Thisoptimization method is illustrated in FIG. 12. At block 1200, anoriginal image block is projected onto a predefined vector, and at 1210its magnitude is stored in a first new block by a decompress device.Next, at block 1220, the first new block is compressed using any of thecompression schemes described below to generate a compressed firstblock. Next, at block 1230, the compressed first block is decompressed.Next, at block 1240, the data value of the decompressed block issubtracted from the data value of the original block to generate a newsecond block. Next, at block 1250, new second block is compressed togenerate a compressed second block. Next, at block 1260, compressedfirst block and compressed second block are combined to generate anoutput block at block 1270.

[0044] A fifth optimization method uses an original image block inconjunction with a series of functions to generate two new blocks. Thisoptimization method is illustrated in FIG. 13. At block 1300, anoriginal image block is projected onto a predefined vector, and at 1310its magnitude is stored in a first new block by a decompress device.Next, at block 1320, the first new block is compressed using any of thecompression schemes described below to generate a compressed firstblock. Next, at block 1330, the compressed first block is decompressed.Next, at block 1340, the data value of the decompressed block issubtracted from the data value of the original block to generate a newsecond block. Next, at block 1350, new second block is compressed togenerate a compressed second block. Next, at block 1360, compressedsecond block is decompressed and its data value subtracted from the datavalue of the original block and the results are stored in a third newblock. Next, at block 1370, the data value of the third new block issubtracted from the data value of the original block and the result isstored back in the first new block. At block 1380, if the desiredthreshold is met, then the compressed first block is combined with thecompressed second block to generate an output block at block 1390, elseblocks 1310-1370 are repeated again.

[0045] One Compression Method

[0046]FIG. 2 illustrates the process of determining a color for a pixelin accordance with one embodiment of the present invention. At block200, a first value associated with a pixel is decoded from a firstcompressed block. At block 210, a second value associated with the samepixel is decoded from a second compressed block. At block 220, the firstand second values are combined to generate an output pixel. In oneembodiment, the values are combined by averaging. In another embodiment,the values are combined by appending one to the end of another. In otherembodiments, other combining functions are used. It should be noted herethat there can be more than two compressed blocks each containing adifferent value associated with the same pixel, but the general idea ofcombining the values of each compressed block to generate an outputpixel remains the same as explained above.

[0047] Another Compression Method

[0048] In one embodiment, a first compressed block is created byencoding each pixel value as an index into a color map. In oneembodiment, the color map maps pixels to a best fit curve with two endpoints in a color space. In one embodiment the curve is a straight line.In one embodiment, the end points of the best fit curve are values towhich the mapping can map. In another embodiment, the mapping can map toan extrapolated value between two endpoints along the best fit curve. Instill another embodiment, the mapping can map to a plurality ofdifferent extrapolated values between two endpoints along the best fitcurve. In one embodiment, the compressed block is comprised of twopoints of the best fit curve and index values for each of the pixels. Inanother embodiment, the two points are the two endpoints.

[0049]FIG. 3 illustrates the process of compressing a decompressed blockin accordance with one embodiment of the present invention. At block300, a best fit curve with endpoints of a pre-determined size isdetermined. At block 310, the endpoints are stored as part of acompressed block. At block 320, each pixel in the decompressed block isencoded as an index into a group of possible color values. In oneembodiment, the possible color values are comprised of the storedendpoints. In another embodiment, the possible color values arecomprised of the stored endpoints and one or more interpolated values onthe best fit curve. At block 330, the indices are stored as part of thecompressed block.

[0050] In an example embodiment, the original block is a four pixel byfour pixel block wherein each pixel value is represented by 24 bits(e.g., a 24-bit RGB color value). Two, 16-bit endpoints for a best fitcurve are stored. Additionally, sixteen 2-bit indices (one for eachpixel in the block) are stored. The indices encode which of the twoendpoint colors or two interpolated values along the curve are thecompressed color for each pixel. The endpoints and the indices comprisea first compressed block.

[0051]FIG. 4 illustrates the process of compressing a 24-bit per pixel,four pixel by four pixel block in accordance with one embodiment of thepresent invention. At block 400, a best fit curve with 16-bit endpointsis determined. At block 410, the 16-bit endpoints are stored as part ofa compressed block. At block 420, each pixel in the block is encoded asa 2-bit index into a group of possible color values. The possible colorvalues are the two 16-bit endpoints and two interpolated values on thecurve. At block 430, the indices are stored as part of the compressedblock. The original block required 384 bits of storage space. Thecompressed block requires only 64 bits of storage space.

[0052] Yet Another Compression Method

[0053] In another embodiment, a compressed block is created by applyinga function to each of the values of the block to obtain new blockvalues. In one embodiment, the function combines components of eachvalue to reduce the amount of space needed to encode the data. In anexample embodiment, 24-bit RGB values are combined to create an 8-bitgrey scale value (e.g., (R+G+B)/3). In one embodiment, the new blockvalues are compressed by encoding the block as an index for mapping ontoa best fit curve. In one embodiment, two endpoints are stored. Inanother embodiment, the indices map to either the two points or any ofone or more interpolated values along the best fit curve. In oneembodiment, the two points are end points. The two stored endpoints andthe block of indices comprise a second compressed block.

[0054]FIG. 5 illustrates the process of compressing a decompressed blockin accordance with one embodiment of the present invention. At block500, a function is applied to each value of the pixel block to obtain anew value. At block 510, a best fit curve with endpoints of apre-determined size is determined using the new values. At block 520,the endpoints are stored as part of a compressed block. At block 530,each pixel in the block is encoded as an index into a group of possiblecolor values. In one embodiment, the possible color values are comprisedof the stored endpoints. In another embodiment, the possible colorvalues are comprised of the stored endpoints and one or moreinterpolated values on the best fit curve. At block 540, the indices arestored as part of the compressed block.

[0055] In an example embodiment, the original block is a four pixel byfour pixel block wherein each pixel value is represented by 24 bits(e.g., a 24-bit RGB color value). The values in the block are convertedto 8-bit grey scale values. Two, 8-bit endpoints for a best fit curveare stored. Additionally, sixteen 3-bit indices (one for each pixel inthe block) are stored. The indices encode which of the two endpointcolors or six interpolated values along the curve are the compressedcolor for each pixel. The endpoints and the indices comprise a thirdcompressed block. Further compressed blocks can be similarly obtained.

[0056]FIG. 6 illustrates the process of compressing a 24-bit per pixel,four pixel by four pixel block in accordance with one embodiment of thepresent invention. At block 600, each 24-bit pixel value is converted toan 8-bit value by applying a function. In one embodiment, the 24-bitpixel value is an RGB value and the function applied is the average ofthe RGB values. At block 610, the new values are placed in a new pixelblock. At block 620, a best fit curve with 8-bit endpoints isdetermined. At block 630, the 8-bit endpoints are stored as part of acompressed block. At block 640, each pixel in the block is encoded as a3-bit index into a group of possible color values. The possible colorvalues are the two 8-bit endpoints and six interpolated values on thecurve. At block 650, the indices are stored as part of the compressedblock. The original block required 384 bits of storage space. Thecompressed block requires only 64 bits of storage space.

[0057] Error Reduction

[0058] In one embodiment, the error generated by compression iscomputed. If the error is greater than a threshold value, one or morevalues of one or more compressed blocks are altered to reduce thecomputed error. Thus, the problem of visual artifacts is reduced. FIG. 7illustrates the process of reducing the occurrence of visual artifactsin accordance with one embodiment of the present invention. At block700, an image is divided into a plurality of pixel blocks. At block 710,each pixel block is decompressed into two decompressed blocks, viz.decompressed first block and decompressed second block. At step 720,decompressed first block is compressed using a first compression method.At block 730, decompressed second block is compressed using a secondcompression method. At block 740, it is determined whether the errorgenerated by the first and second compression methods is greater than athreshold value. If the error generated is not greater than thethreshold value, at block 750, the encoding is acceptable. If the errorgenerated is greater than the threshold value, at block 760, the valuesin the compressed blocks are altered to reduce the error. It should benoted here that FIG. 7 is by way of an example that uses only twodecompressions of an original pixel block, but any number ofdecompressions are possible depending on the quality of compressiondesired, memory constraints of the computer, or other factors withoutdeparting from the scope of the present invention.

[0059] Alternative Color Encodings

[0060] In one embodiment, the color values are encoded as YCrCb. In oneembodiment, the Y component is encoded in one compressed block and CrCbendpoints are used to encode another compressed block. In anotherembodiment, the color values are encoded as RGB values. One of the RGBcomponents are encoded in one compressed block and endpoints in theother two components' color spaces are used to encode another compressedblock.

[0061] In one embodiment, the function associated with creation of oneor more compressed block is not a grey scale function. Instead, a vectorthat represents the axis of the function is stored in the compressedblock. In one embodiment, the vector is of unit length. In anotherembodiment, the vector is of non-unit length. In one embodiment, thevector is a 16-bit axis vector stored in addition to the endpoints andindices as part of the compressed block. In another embodiment, two8-bit Theta-Phi axis components are stored in addition to the endpointsand indices as part of the one or more compressed blocks. The Theta-Phiaxis components represent angle and elevation of the axis vector on ahemisphere. In one embodiment, the number of bits per index is reducedto allow storage of the vector value without increasing the size of acompressed block beyond a desired maximum size. In various otherembodiments, more than one compressed blocks are encoded to representeach original block. Specific bit values have been for the purpose ofexample. One of ordinary skill in the art will recognize thatembodiments of the present invention may be practiced with originalpixel values of any size, using any color encoding scheme, andgenerating one or more compressed blocks.

[0062] Embodiment of Computer Execution Environment (Hardware)

[0063] An embodiment of the invention can be implemented as computersoftware in the form of computer readable program code executed in ageneral purpose computing environment such as environment 800illustrated in FIG. 8. A keyboard 810 and mouse 811 are coupled to asystem bus 818. The keyboard and mouse are for introducing user input tothe computer system and communicating that user input to centralprocessing unit (CPU) 813. Other suitable input devices may be used inaddition to, or in place of, the mouse 811 and keyboard 810. I/O(input/output) unit 819 coupled to bi-directional system bus 818represents such I/O elements as a printer, ANV (audio/video) I/O, etc.

[0064] Computer 801 may include a communication interface 820 coupled tobus 818. Communication interface 820 provides a two-way datacommunication coupling via a network link 821 to a local network 822.For example, if communication interface 820 is an integrated servicesdigital network (ISDN) card or a modem, communication interface 820provides a data communication connection to the corresponding type oftelephone line, which comprises part of network link 821. Ifcommunication interface 820 is a local area network (LAN) card,communication interface 820 provides a data communication connection vianetwork link 821 to a compatible LAN. Wireless links are also possible.In any such implementation, communication interface 820 sends andreceives electrical, electromagnetic or optical signals which carrydigital data streams representing various types of information.

[0065] Network link 821 typically provides data communication throughone or more networks to other data devices. For example, network link821 may provide a connection through local network 822 to local servercomputer 823 or to data equipment operated by ISP 824. ISP 824 in turnprovides data communication services through the world wide packet datacommunication network now commonly referred to as the “Internet” 825.Local network 822 and Internet 825 both use electrical, electromagneticor optical signals which carry digital data streams. The signals throughthe various networks and the signals on network link 821 and throughcommunication interface 820, which carry the digital data to and fromcomputer 800, are exemplary forms of carrier waves transporting theinformation.

[0066] Processor 813 may reside wholly on client computer 801 or whollyon server 826 or processor 813 may have its computational powerdistributed between computer 801 and server 826. Server 826 symbolicallyis represented in FIG. 8 as one unit, but server 826 can also bedistributed between multiple “tiers”. In one embodiment, server 826comprises a middle and back tier where application logic executes in themiddle tier and persistent data is obtained in the back tier. In thecase where processor 813 resides wholly on server 826, the results ofthe computations performed by processor 813 are transmitted to computer801 via Internet 825, Internet Service Provider (ISP) 824, local network822 and communication interface 820. In this way, computer 801 is ableto display the results of the computation to a user in the form ofoutput.

[0067] Computer 801 includes a video memory 814, main memory 815 andmass storage 812, all coupled to bi-directional system bus 818 alongwith keyboard 810, mouse 811 and processor 813. As with processor 813,in various computing environments, main memory 815 and mass storage 812,can reside wholly on server 826 or computer 801, or they may bedistributed between the two.

[0068] The mass storage 812 may include both fixed and removable media,such as magnetic, optical or magnetic optical storage systems or anyother available mass storage technology. Bus 818 may contain, forexample, thirty-two address lines for addressing video memory 814 ormain memory 815. The system bus 818 also includes, for example, a 32-bitdata bus for transferring data between and among the components, such asprocessor 813, main memory 815, video memory 814 and mass storage 812.Alternatively, multiplex data/address lines may be used instead ofseparate data and address lines.

[0069] In one embodiment of the invention, the microprocessor ismanufactured by Intel, such as the 80×86 or Pentium-typed processor.However, any other suitable microprocessor or microcomputer may beutilized. Main memory 815 is comprised of dynamic random access memory(DRAM). Video memory 814 is a dual-ported video random access memory.One port of the video memory 814 is coupled to video amplifier 816. Thevideo amplifier 816 is used to drive the cathode ray tube (CRT) rastermonitor 817. Video amplifier 816 is well known in the art and may beimplemented by any suitable apparatus. This circuitry converts pixeldata stored in video memory 814 to a raster signal suitable for use bymonitor 817. Monitor 817 is a type of monitor suitable for displayinggraphic images.

[0070] Computer 801 can send messages and receive data, includingprogram code, through the network(s), network link 821, andcommunication interface 820. In the Internet example, remote servercomputer 826 might transmit a requested code for an application programthrough Internet 825, ISP 824, local network 822 and communicationinterface 820. The received code may be executed by processor 813 as itis received, and/or stored in mass storage 812, or other non-volatilestorage for later execution. In this manner, computer 800 may obtainapplication code in the form of a carrier wave. Alternatively, remoteserver computer 826 may execute applications using processor 813, andutilize mass storage 812, and/or video memory 815. The results of theexecution at server 826 are then transmitted through Internet 825, ISP824, local network 822 and communication interface 820. In this example,computer 801 performs only input and output functions.

[0071] Application code may be embodied in any form of computer programproduct. A computer program product comprises a medium configured tostore or transport computer readable code, or in which computer readablecode may be embedded. Some examples of computer program products areCD-ROM disks, ROM cards, floppy disks, magnetic tapes, computer harddrives, servers on a network, and carrier waves.

[0072] The computer systems described above are for purposes of exampleonly. An embodiment of the invention may be implemented in any type ofcomputer system or programming or processing environment.

[0073] Thus, a method and apparatus for block based image compressionwith multiple non-uniform block encodings is described in conjunctionwith one or more specific embodiments. The invention is defined by thefollowing claims and their full scope and equivalents.

We claim:
 1. A method for compressing an image comprising: partitioningsaid image into a plurality of pixel blocks; decompressing each of saidplurality of pixel blocks to generate a plurality of decompress blocks;compressing each of said plurality of decompress blocks to generate aplurality of compressed blocks; and combining each of said plurality ofcompressed blocks to generate an output block.
 2. The method of claim 1wherein said image is a texture.
 3. The method of claim 1 wherein saidfirst pixel block is four pixels by four pixels.
 4. The method of claim1 wherein said first pixel block has 24 bits for each pixel.
 5. Themethod of claim 1 wherein said compressing uses one or more compressiontechniques.
 6. The method of claim 1 wherein said step of compressingeach of said plurality of decompress blocks comprises: determining abest fit curve in a color space; storing two points of said best fitcurve; and storing an index value for a first pixel value in said firstpixel block wherein said index maps to a collection of possible colors.7. The method of claim 6 wherein said collection of possible colorscomprises: colors of said two points.
 8. The method of claim 6 whereinsaid collection of possible colors comprises: an interpolated valuewherein said interpolated value is on said best fit curve.
 9. The methodof claim 6 wherein said two points are 16-bit values.
 10. The method ofclaim 6 wherein said index value is a 2-bit value.
 11. The method ofclaim 6 wherein said two points are endpoints of said best fit curve.12. The method of claim 6 wherein said first pixel value is an RGBvalue.
 13. The method of claim 6 wherein said first pixel value is aYCrCb value.
 14. The method of claim 1 wherein said step of compressingeach of said plurality of decompress blocks comprises: applying afunction to a first pixel value to produce an altered first pixel value;determining a best fit curve in a color space; storing two points ofsaid best fit curve; and storing an index value for said altered firstpixel value in said first pixel block wherein said index maps to acollection of possible colors.
 15. The method of claim 14 wherein saidcollection of possible colors comprises: colors of said two points. 16.The method of claim 14 wherein said collection of possible colorscomprises: an interpolated value wherein said interpolated value is onsaid best fit curve.
 17. The method of claim 14 wherein said two pointsare 8-bit values.
 18. The method of claim 14 wherein said index value isa 3-bit value.
 19. The method of claim 14 wherein said two points areendpoints of said best fit curve.
 20. The method of claim 14 whereinsaid first pixel value has more bits than said altered pixel value. 21.The method of claim 14 wherein said function is an averaging function.22. The method of claim 21 wherein said function averages a redcomponent, a green component and a blue component.
 23. The method ofclaim 14 wherein said first pixel value is an RGB value.
 24. The methodof claim 14 wherein said first pixel value is a YCrCb value.
 25. Themethod of claim 1 further comprising: storing a set of global data foruse in decompressing said image.
 26. The method of claim 1 wherein saiddecompressing is optimized for each of said plurality of pixel blocks toreduce loss of image quality.
 27. The method of claim 26 whereinoptimization of each of said plurality of pixel blocks furthercomprises: compressing a first subset comprising of one or moredecompress blocks to generate a first compressed subset; decompressingsaid first compressed subset; feeding results of decompressing of firstcompressed subset to a decompress device that changes the data value ofa second subset comprising of one or more decompressed blocks differentfrom first subset; and compressing second subset.
 28. The method ofclaim 26 wherein optimization of each of said plurality of pixel blocksfurther comprises: compressing a first subset comprising of one or moredecompressed blocks to generate a first compressed subset; decompressingsaid first compressed subset; feeding results of decompressing of firstcompressed subset to a decompress device that changes the data value ofa second subset comprising of one or more decompressed blocks differentfrom first subset to generate a new second subset; compressing said newsecond subset; decompressing said new second subset; feeding results ofdecompressing of new second subset to said decompress device thatchanges the data value of said first subset; and repeating steps ofcompressing, decompressing, and feeding of said first subset andrepeating steps of compressing, decompressing, and feeding of said newsecond subset until a threshold is achieved.
 29. The method of claim 26wherein optimization of each of said plurality of pixel blocks furthercomprises: projecting an original block onto a predefined vector togenerate a projected; concurrently storing a magnitude of said originalblock in a first new block and subtracting said projected block fromsaid original block.
 30. The method of claim 26 wherein optimization ofeach of said plurality of pixel blocks further comprises: projecting anoriginal block onto a predefined vector to generate a projected; storinga magnitude of said original block in a first new block; compressingsaid first new block to generate a compressed first block; decompressingsaid compressed first block to generate a decompressed block;subtracting data value of said decompressed block from data value ofsaid original block to generate a new second block; compressing said newsecond block to generate a compressed second block; and combining saidcompressed first block and said compressed second block.
 31. The methodof claim 26 wherein optimization of each of said plurality of pixelblocks further comprises: projecting an original block onto a predefinedvector to generate a projected; storing a magnitude of said originalblock in a first new block; compressing said first new block to generatea compressed first block; decompressing said compressed first block togenerate a first decompressed block; subtracting data value of saidfirst decompressed block from data value of said original block togenerate a new second block; compressing said new second block togenerate a compressed second block; decompressing said compressed secondblock to generate a second decompressed block; subtracting data value ofsaid second decompressed block from data value of said original blockand storing results in a third block; subtracting data value of saidthird block from data value of said original block and storing theresults in said first new block; repeating steps of storing,compressing, decompressing, and subtracting of said first new block,repeating steps of compressing, decompressing, and subtracting of saidnew second block, and repeating steps of subtracting of said third blockuntil a threshold is achieved; and combining said compressed first blockwith said compressed second block.
 32. An image compression systemcomprising: a partitioner configured to partition an image into aplurality of pixel blocks; a decompression unit configured to decompresseach of said plurality of pixel blocks to generate a plurality ofdecompress blocks; a compression unit configured to compress each ofsaid plurality of decompress blocks to generate a plurality ofcompressed blocks; and a combining unit configured to combine each ofsaid plurality of compressed blocks to generate an output block.
 33. Theimage compression system of claim 32 wherein said image is a texture.34. The image compression system of claim 32 wherein said first pixelblock is four pixels by four pixels.
 35. The image compression system ofclaim 32 wherein said first pixel block has 24 bits for each pixel. 36.The image compression system of claim 32 wherein said compression unituses one or more compression techniques.
 37. The image compressionsystem of claim 32 wherein said first compression unit comprises: adeterminer configured to determine a best fit curve in a color space;and a storage device configured to store two points of said best fitcurve, wherein said storage device is further configured to store anindex value for a first pixel value in said first pixel block whereinsaid index maps to a collection of possible colors.
 38. The imagecompression system of claim 37 wherein said collection of possiblecolors comprises: colors of said two points.
 39. The image compressionsystem of claim 29 wherein said collection of possible colors comprises:an interpolated value wherein said interpolated value is on said bestfit curve.
 40. The image compression system of claim 37 wherein said twopoints are 16-bit values.
 41. The image compression system of claim 37wherein said index value is a 2-bit value.
 42. The image compressionsystem of claim 37 wherein said two points are endpoints of said bestfit curve.
 43. The image compression system of claim 37 wherein saidfirst pixel value is an RGB value.
 44. The image compression system ofclaim 37 wherein said first pixel value is a YCrCb value.
 45. The imagecompression system of claim 32 wherein said compression unit comprises:a calculator configured to apply a function to a first pixel value toproduce an altered first pixel value; a determiner configured todetermine a best fit curve in a color space; and a storage unitconfigured to store two points of said best fit curve, wherein saidstorage unit is further configured to store an index value for saidaltered first pixel value in said first pixel block wherein said indexmaps to a collection of possible colors.
 46. The image compressionsystem of claim 45 wherein said collection of possible colors comprises:colors of said two points.
 47. The image compression system of claim 45wherein said collection of possible colors comprises: an interpolatedvalue wherein said interpolated value is on said best fit curve.
 48. Theimage compression system of claim 45 wherein said two points are 8-bitvalues.
 49. The image compression system of claim 45 wherein said indexvalue is a 3-bit value.
 50. The image compression system of claim 45wherein said two points are endpoints of said best fit curve.
 51. Theimage compression system of claim 45 wherein said first pixel value hasmore bits than said altered pixel value.
 52. The image compressionsystem of claim 45 wherein said function is an averaging function. 53.The image compression system of claim 52 wherein said function averagesa red component, a green component and a blue component.
 54. The imagecompression system of claim 45 wherein said first pixel value is an RGBvalue.
 55. The image compression system of claim 45 wherein said firstpixel value is a YCrCb value.
 56. The image compression system of claim32 further comprising: a second storage device configured to store a setof global data for use in decompressing said image.
 57. The imagecompression system of claim 32 wherein said decompressing unit isoptimized for each of said plurality of pixel blocks to reduce loss ofimage quality.
 58. The image compression system of claim 57 whereinoptimization of each of said plurality of pixel blocks furthercomprises: a first compressing unit configured to compress a firstsubset comprising of one or more decompress blocks to generate a firstcompressed subset; a decompressing unit configured to decompress saidfirst compressed subset; a feeding unit configured to feed results ofdecompression of first compressed subset to a decompress device thatchanges the data value of a second subset comprising of one or moredecompressed blocks different from first subset; and a secondcompressing unit configured to compress second subset.
 59. The imagecompression system of claim 57 wherein optimization of each of saidplurality of pixel blocks further comprises: a first compression unitconfigured to compress a first subset comprising of one or moredecompressed blocks to generate a first compressed subset; a firstdecompressing unit configured to decompress said first compressedsubset; a first feeding unit configured to feed results of decompressingof first compressed subset to a decompress device that changes the datavalue of a second subset comprising of one or more decompressed blocksdifferent from first subset to generate a new second subset; a secondcompression unit configured to compress said new second subset; a seconddecompressing unit configured to decompress said new second subset; asecond feeding unit configured to feed results of decompressing of newsecond subset to said decompress device that changes the data value ofsaid first subset; and a repeating unit configured to repeat steps ofcompress, decompress, and feed said first subset and repeating steps ofcompress, decompress, and feed said new second subset until a thresholdis achieved.
 60. The image compression system of claim 57 whereinoptimization of each of said plurality of pixel blocks furthercomprises: a projection unit configured to project an original blockonto a predefined vector to generate a projected; a device configured toconcurrently store a magnitude of said original block in a first newblock and subtract said projected block from said original block. 61.The image compression system of claim 57 wherein optimization of each ofsaid plurality of pixel blocks further comprises: a projection unitconfigure to project an original block onto a predefined vector togenerate a projected; a storing unit configured to store a magnitude ofsaid original block in a first new block; a first compression unitconfigured to compress said first new block to generate a compressedfirst block; a decompression unit configured to decompress saidcompressed first block to generate a decompressed block; a subtractingunit configured to subtract data value of said decompressed block fromdata value of said original block to generate a new second block; asecond compression unit configured to compress said new second block togenerate a compressed second block; and a combining unit configured tocombine said compressed first block and said compressed second block.62. The image compression unit of claim 57 wherein optimization of eachof said plurality of pixel blocks further comprises: a projection unitconfigured to project an original block onto a predefined vector togenerate a projected; a storing unit configured to store a magnitude ofsaid original block in a first new block; a first compressing unitconfigured to compress said first new block to generate a compressedfirst block; a first decompressing unit configured to decompress saidcompressed first block to generate a first decompressed block; a firstsubtracting unit configured to subtract data value of said firstdecompressed block from data value of said original block to generate anew second block; a second compressing unit configured to compress saidnew second block to generate a compressed second block; a seconddecompressing unit configured to decompress said compressed second blockto generate a second decompressed block; a second subtracting unitconfigured to subtract data value of said second decompressed block fromdata value of said original block and storing results in a third block;a third subtracting unit configured to subtract data value of said thirdblock from data value of said original block and storing the results insaid first new block; a repeating unit configured to repeat steps tostore, compress, decompress, and subtract of said first new block,repeat steps to compress, decompress, and subtract of said new secondblock, and repeat steps to subtract said third block until a thresholdis achieved; and a combining unit configured to combine said compressedfirst block with said compressed second block.